<?php /* Smarty version 2.6.18, created on 2010-03-12 09:24:10
         compiled from tank.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'tank.tpl', 50, false),)), $this); ?>
<div id="blanket" style="display:none; z-index: 800;"></div>
<div id="editTank" style="background-color:#fff;width:500px;z-index: 900;display:none;position: absolute;">
</div>
<script>	
	var dd = new ekimo_drag_region("content","editTank");
</script>
<div id="main_content">
    	<h1>Tank List</h1>
        
			<div class="blue">
        	    <form action="" id="filterForm" >
        	        <table style="width: 100%">
        	            <tr align="right">
        	            	<td style="width: 60px">Systems :</td>
        					<td style="width: 120px">
									<select name="user[system_name]" onchange="showTanks(this.value);">
	        						<option value="all">All Systems</option>
	        						<?php $_from = $this->_tpl_vars['systems']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['system']):
?>
	        							<option value="<?php echo $this->_tpl_vars['system']['system_name']; ?>
"><?php echo $this->_tpl_vars['system']['system_name']; ?>
</option>
	        						<?php endforeach; endif; unset($_from); ?>
									</select>
        					</td>   
        					<td colspan="5" style="width: 20px">
								&nbsp;
        					</td> 							     	        	
        	            <tr align="right">
        					<td colspan="6" style="width: 100px">
								<input type="button" value="New Tank" onclick="editTank(0);"/>
        					</td>
        	            </tr>
        	        </table>
        	    </form>
        	</div>

            <div id="result">
				<div>
					<table border="0" width="100%">
						<tr><td colspan="5"><hr></td></tr>
						<tr>
						<?php if ($this->_tpl_vars['tanks'][0]['name'] <> ''): ?>
							<td align="center" style="padding-left: 5pt; padding-right:5pt" width="80px">Edit</td>
						<?php endif; ?>
							<td>Name</td>
							<td width="300px">Description</td>
							<td align="right">Installed</td>
							<td align="right">Dimensions</td>
						</tr>
						<tr><td colspan="5"><hr></td></tr>
						<?php $_from = $this->_tpl_vars['tanks']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['tank']):
?>
						<tr class="<?php echo smarty_function_cycle(array('values' => 'blue,notify'), $this);?>
">
							<td align="center">
								<a href="javascript:void(0);" onclick="editTank('<?php echo $this->_tpl_vars['tank']['tank_id']; ?>
');">Edit</a>
							</td>					
							<td><?php echo $this->_tpl_vars['tank']['name']; ?>
</td>
							<td><?php echo $this->_tpl_vars['tank']['description']; ?>
</td>
							<td align="right"><?php echo $this->_tpl_vars['tank']['date_installed']; ?>
</td>
							<td align="right"><?php echo $this->_tpl_vars['tank']['dimensions']; ?>
</td>
						</tr>
						<?php endforeach; endif; unset($_from); ?>
					</table>
				</div>
            </div><!-- results -->
            
</div>
<script language="javascript">
<?php echo '
	function editTank(tankId){
		doajaxAction("/account/editTank/tankId/"+tankId,0,\'editTank\');
		popup("editTank");
	}
	function showTanks(name) {
		doajaxAction("/account/tanks/system_name/"+name,1,\'result\', document.getElementById(\'filterForm\'));
	}	
'; ?>

</script>